<template></template>
<script>
export default {
  created() {
    // 数组
    let num1 = 10;
    let num2 = 20;

    let temp = num1;
    num1 = num2;
    num2 = temp;
    console.log(num1, num2);

    num1 = num2 ^ num1;
    num2 = num1 ^ num2;
    num1 = num2 ^ num1;
    console.log(num1, num2);

    [num1, num2] = [num2, num1];
    console.log(num1, num2);

    // 字符串
    let [str1, str2] = "hello";
    console.log(str1, str2);

    // 对象
    let obj = {
      name: "tom",
      age: 18,
      gender: "boy",
    };
    let { name, age, gender } = obj;
    console.log(name, age, gender);
  },
};
</script>